package com.libin8002.controller;


import com.libin.entities.CommonResult;
import com.libin.entities.Payment;
import com.libin8002.service.impl.PaymentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/payment")
public class PaymentController {
    @Autowired
    PaymentServiceImpl paymentService;

    @GetMapping("select/{id}")
    public CommonResult select(@PathVariable("id") Integer id){
        System.out.println(id);
        return paymentService.select(id);
    }

    @PostMapping("add")
    public CommonResult add(@RequestBody Payment payment){
        System.out.println(payment);
        return paymentService.add(payment);
    }
}
